Skip to content

.NET: Workflows: quarantine flaky InputWaiter timeout test (#7360) - #7361

Merged
rogerbarreto merged 1 commit into
microsoft:mainfrom
rogerbarreto:fix/skip-flaky-inputwaiter-timeout-test
Jul 28, 2026
Merged

.NET: Workflows: quarantine flaky InputWaiter timeout test (#7360)#7361
rogerbarreto merged 1 commit into
microsoft:mainfrom
rogerbarreto:fix/skip-flaky-inputwaiter-timeout-test

Conversation

@rogerbarreto

Copy link
Copy Markdown
Member

Summary

Quarantines the flaky workflows unit test InputWaiterTests.InputWaiter_WaitForInputAsync_CompletesWhenTimeoutExpiresAsync so the merge_group queue stops blocking on it. Tracking issue: #7360.

Why

Across the last 18 failed dotnet-build-and-test runs, this test failed 7 times, always on the net472 / windows-latest leg and always in a merge_group run. It blocks PRs that do not touch the workflows code at all: the most recent occurrence blocked #7337, which only adds a sample.

Run Date PR
30299144911 2026-07-27 #7337 (GitHub Copilot BYOK sample)
30293327057 2026-07-27
29760053213 2026-07-20
29312897500 2026-07-14
29284546765 2026-07-13
29274908654 2026-07-13
29273373355 2026-07-13

Failure signature:

Expected object to refer to System.Threading.Tasks.Task`1[System.Threading.Tasks.VoidTaskResult] {Status=WaitingForActivation}
because the wait task should complete once the timeout expires,
but found System.Threading.Tasks.Task+DelayPromise {Status=RanToCompletion}.

The test races a 300 ms SemaphoreSlim timeout against a 5 s Task.Delay guard and then asserts which one won by object identity. On the loaded net472 leg, thread pool starvation can delay the 300 ms continuation past the 5 s guard, so Task.Delay wins the WhenAny and BeSameAs fails. InputWaiter itself is behaving correctly, the test just cannot guarantee it observes the timeout in time. See #7360 for the full hypothesis.

Change

Replace [Fact] with [Fact(Skip = "Flaky in merge_group; see https://github.com/microsoft/agent-framework/issues/7360")] on the affected test, matching the convention already used for #5845, and add a short comment explaining why the existing outer bound is not sufficient.

No product code changes.

Validation

  • dotnet build --tl:off --framework net472 on Microsoft.Agents.AI.Workflows.UnitTests succeeds with 0 warnings, 0 errors.
  • Running the class on net472 reports total: 7, failed: 0, skipped: 1, with the skipped test being the quarantined one.
  • dotnet format --verify-no-changes on the changed file passes.

Follow-up

The assertion should be rewritten so it no longer depends on scheduling latency, then the test re-enabled. Note that Task.WaitAsync(TimeSpan) is not available on net472, so any replacement has to work on .NET Framework as well. Tracked in #7360.

InputWaiter_WaitForInputAsync_CompletesWhenTimeoutExpiresAsync races a
300ms SemaphoreSlim timeout against a 5s Task.Delay guard and asserts
which one won by object identity. On the loaded net472/windows-latest
leg, thread pool starvation can delay the 300ms continuation past the
5s guard, so Task.Delay wins and the assertion fails.

It failed in 7 of the last 18 failed dotnet-build-and-test runs, always
on net472/windows-latest and always in merge_group, blocking PRs that
do not touch the workflows code.

Quarantine it following the existing convention used for microsoft#5845, and
track the real fix in microsoft#7360.

Copilot-Session: 0be6f810-51de-4f49-b9c7-8d1c7efa2c43
Copilot AI review requested due to automatic review settings July 28, 2026 11:00
@agent-framework-automation agent-framework-automation Bot added the .NET Usage: [Issues, PRs], Target: .Net label Jul 28, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Quarantines a known-flaky .NET workflows unit test to stop merge_group runs (notably net472/windows-latest) from being blocked by intermittent timing/scheduling races in the test harness rather than product behavior.

Changes:

  • Marks InputWaiter_WaitForInputAsync_CompletesWhenTimeoutExpiresAsync as skipped with a link to issue #7360.
  • Adds an inline comment documenting why the existing Task.WhenAny outer-bound guard is still insufficient under load.

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Automated Code Review

Reviewers: 5 | Confidence: 95% | Result: All clear

Reviewed: Correctness, Security Reliability, Test Coverage, Failure Modes, Design Approach


Automated review by rogerbarreto's agents

@rogerbarreto rogerbarreto self-assigned this Jul 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

.NET Usage: [Issues, PRs], Target: .Net

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants